package com.xyz.domain.ext;

public enum  EnumEventType {

    RegistEvent("注册行为","REG_EVENT"),
    SignEvent("签到行为","SIGN_EVENT");

    private String name;

    private String type;

    EnumEventType(String name, String type){
        this.name = name;
        this.type = type;
    }

    public EnumEventType getByKey(String type){
        for(EnumEventType source : EnumEventType.values()){
            if(source.getType().equals(type)){
                return source;
            }
        }
        return  null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "EnumEventType{" +
                "name='" + name + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
